package com.alibaba.dubbo.common;

import java.util.Map;

/**
 * 
 * @author aruan
 * 2014.09.13
 */
public interface AttachmentsProvider {
	/**
	 * get attachments.
	 * 
	 * @serial
	 * @return attachments.
	 */
	Map<String, String> getAttachments();
	
	/**
     * get attachment by key.
     * 
     * @serial
     * @return attachment value.
     */
	String getAttachment(String key);
	
	/**
     * get attachment by key with default value.
     * 
     * @serial
     * @return attachment value.
     */
	String getAttachment(String key, String defaultValue);
	
	/**
	 * remove attachment by key
	 * @param key
	 */
	void removeAttachment(String key);
	
	/**
	 * remove all attachment
	 */
	void removeAttachments();
}
